#!/usr/bin/python

import wx

class Frame1(wx.Frame):
    def __init__(self, parent):
        wx.Frame.__init__(self, id=101, name='', parent=parent,
              pos=wx.Point(198, 198), size=wx.Size(400, 250),
              style=wx.DEFAULT_FRAME_STYLE, title='Frame1')
        self.SetClientSize(wx.Size(392, 223))

        self.treeCtrl1 = wx.TreeCtrl(id=102, name='treeCtrl1',
              parent=self, pos=wx.Point(16, 16), size=wx.Size(248, 176),
              style=wx.TR_HAS_BUTTONS)
        root = self.treeCtrl1.AddRoot("Upload/Download",image = -1, data =None)
        child = self.treeCtrl1.AppendItem(root,"Probando")
        self.treeCtrl1.SetPyData(child, None)
        #self.vista.tree.SetItemImage(child, self.vista.fldropenidx, wx.TreeItemIcon_Normal)
        #self.vista.tree.SetItemImage(child, self.vista.fldridx, wx.TreeItemIcon_Expanded)

        self.treeCtrl1.Bind(wx.EVT_TREE_BEGIN_DRAG,
              self.OnTreeCtrl1TreeBeginDrag, id=102)

    def OnTreeCtrl1TreeBeginDrag(self, event):
        print self.treeCtrl1.GetItemText(event.GetItem())
        print "calling begin drag"
        event.Skip()        


class BoaApp(wx.App):
    def OnInit(self):
        wx.InitAllImageHandlers()
        self.main = Frame1(None)
        self.main.Show()
        self.SetTopWindow(self.main)
        return True

def main():
    application = BoaApp(0)
    application.MainLoop()

if __name__ == '__main__':
    main()

